package blackstar.performance;

/**
 * @author RayWoo (ayufox@gmail.com)
 * 
 */
public class PerformanceStat implements LogStat
{
	private long bufferSize = 0;
	private long logBytes = 0;
	private long logTimes = 0;
	private long logTimeNano = 0;

	public synchronized void log(long logBytes, long logTimeNano)
	{
		this.logBytes += logBytes;
		this.logTimes++;
		if (logTimeNano > 0)
		{
			this.logTimeNano += logTimeNano;
		}
	}

	public long getBufferSize()
	{
		return bufferSize;
	}

	public void setBufferSize(long bufferSize)
	{
		this.bufferSize = bufferSize;
	}

	public long getLogBytes()
	{
		return this.logBytes;
	}

	public long getLogTimes()
	{
		return this.logTimes;
	}

	public long getLogTimeNano()
	{
		return logTimeNano;
	}
}
